#include "Thread.hpp"
#include <vector>
#include <string>

void test()
{
    int cnt = 100;
    while(cnt--)
    {
        std::cout << "新线程正在运行" << std::endl;
        sleep(1);
    }
}

int main()
{
    std::vector<Thread> threads;
    for(int i =1; i <= 5; ++i)
    {
        std::string name = "thread-";
        name += std::to_string(i);
        Thread thread(test, name);
        threads.push_back(thread);
    }

    for(auto& thread : threads)
        thread.Start();
    
    for(auto& thread : threads)
        thread.Join();
    
    return 0;
}